import request from '@/utils/request'

export function getShelters(pageIndex, pageSize, userName, account, sheltersId, beginDate, endDate) {
  return request({
    url: '/user/shelters',
    method: 'get',
    params: { pageIndex, pageSize, userName, account, sheltersId, beginDate, endDate }
  })
}

export function insertShelters(data, sheltersId) {
  return request({
    url: '/user/shelters/prison/' + sheltersId,
    method: 'post',
    data
  })
}

export function getSheltersList() {
  return request({
    url: '/shelter/shelters',
    method: 'get'
  })
}

export function deleteShelters(userId) {
  return request({
    url: '/user/user/' + userId,
    method: 'delete'
  })
}

export function updateShelters(sheltersId, roleId, data) {
  return request({
    url: '/user/shelters/' + roleId,
    method: 'put',
    params: { sheltersId },
    data
  })
}